﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TCDL.GLOBAL;
using TCDL.BUS;

namespace TCDL
{
    public partial class frmDangKyNV : Form
    {
        public frmDangKyNV()
        {
            InitializeComponent();
        }

        private void btnDangKy_Click(object sender, EventArgs e)
        {
            // Code phát sinh mã khách hàng
            String strMaNV = "NV001";
            // End
            
            int iMLTK = 1;
            if (rbPhuLai.Checked)
            {
                iMLTK = 2;
            }
            int iCount = 11;
            gConnect[] gCon = new gConnect[iCount];
            gCon[0] = new gConnect("@manv", strMaNV);
            gCon[1] = new gConnect("@holot", "N");
            gCon[2] = new gConnect("@tennv", txtHoTen.Text.Trim());
            gCon[3] = new gConnect("@ngaysinh", "1985-08-25");
            gCon[4] = new gConnect("@gioitinh", 1);
            gCon[5] = new gConnect("@diachi", txtDiaChi.Text.Trim());
            gCon[6] = new gConnect("@dienthoai", txtDienThoai.Text.Trim());
            gCon[7] = new gConnect("@maloaitk", iMLTK);
            gCon[8] = new gConnect("@tendn", txtNguoiDung.Text.Trim());
            gCon[9] = new gConnect("@matkhau", txtMatKhau.Text.Trim());
            gCon[10] = new gConnect("@hinhanh", null);

            XemDSBUS ds = new XemDSBUS();
            ds.ThemDS("sp_ThemNhanVien", gCon, iCount);
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}